package com.tenbent.product.center.insures.service.impl;

import com.tenbent.product.base.service.impl.BaseServiceImpl;
import com.tenbent.product.center.insures.bo.SkuInfo;
import com.tenbent.product.center.insures.dto.SkuInfoDto;
import com.tenbent.product.center.insures.mapper.SkuInfoMapper;
import com.tenbent.product.center.insures.service.SkuInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by ThinkPad on 2017/8/21.
 */
@Service(value = "skuInfoServiceImpl")
public class SkuInfoServiceImpl extends BaseServiceImpl<SkuInfo> implements SkuInfoService {

	public SkuInfoServiceImpl() {
		this.setClazz(SkuInfo.class);
	}

	@Autowired
	private SkuInfoMapper skuInfoMapper;

	@Override
	public List<SkuInfoDto> findSkuInfoByProductId(Integer productId) {

		SkuInfo query = new SkuInfo();
		query.setProductId(productId);
		return change.changesToDTOList(this.queryObj(query), SkuInfoDto.class);
	}
}
